function checkName(){
	var ajax = createAjax();
	var username = document.getElementById('username').value;
	var password=document.getElementById('password').value;
	var url = "http://www.a.com/Ajaxlogin/index";
	var str="username="+username;
//	+"password"+password;
	
	ajax.open("POST", url, true);
	ajax.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
	ajax.send(str);
	ajax.onreadystatechange = function(){
		
		if (ajax.readyState == 4) {
//			alert(ajax.responseText);
//            alert(ajax.status);
			var res = ajax.responseText;
			alert(ajax.responseText);
//			
			var con = "";
			if (res == 1) {
				con = "<font>可以登录</font>"
			}
			else if(res == 0){
				con = "<font>您的用户名或密码错误</font>"

			} 
			document.getElementById("ajax_success").innerHTML = con;
		}
	}

}




